package com.likai;

import com.likai.dao.IJarMapper;
import com.likai.pojo.JarBean;
import com.likai.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.Date;
import java.util.UUID;

/**
 * Created by likai on 2018/10/11.
 */
public class Test {
    public static void main(String [] args) {

        SqlSession sqlSession = null ;
        sqlSession = SqlSessionFactoryUtil.openSqlSession() ;
        IJarMapper jarMapper = sqlSession.getMapper(IJarMapper.class) ;
        JarBean jarBean = jarMapper.selectJarById("1") ;

        JarBean jar = new JarBean() ;
        jar.setUuid(UUID.randomUUID().toString());
        jar.setName("11111");
        jar.setPath("222222222222");
        jar.setUpdateDate(new Date());
        //jar包
        jar.setType("jar");
        //添加
        int state = jarMapper.insertDynamic(jar) ;

        sqlSession.close();
    }
}
